#!/usr/bin/env python
# vim:fileencoding=utf-8

from calibre.web.feeds.news import BasicNewsRecipe


class RadioSvoboda(BasicNewsRecipe):
    title = '\u0420\u0430\u0434\u0456\u043E \u0421\u0432\u043E\u0431\u043E\u0434\u0430'
    __author__ = 'bugmen00t'
    description = '\u0420\u0430\u0434\u0456\u043E\u0441\u0442\u0430\u043D\u0446\u0456\u044F \u0442\u0430 \u0456\u043D\u0442\u0435\u0440\u043D\u0435\u0442-\u0432\u0438\u0434\u0430\u043D\u043D\u044F, \u044F\u043A\u0430 \u043F\u043E\u0437\u0438\u0446\u0456\u043E\u043D\u0443\u0454 \u0441\u0435\u0431\u0435 \u044F\u043A \u043F\u0440\u0438\u0432\u0430\u0442\u043D\u0438\u0439 \u043D\u0435\u043A\u043E\u043C\u0435\u0440\u0446\u0456\u0439\u043D\u0438\u0439 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u0439\u043D\u043E-\u043D\u043E\u0432\u0438\u043D\u043D\u0438\u0439 \u0437\u0430\u0441\u0456\u0431 \u043C\u0430\u0441\u043E\u0432\u043E\u0457 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u0457.'  # noqa: E501
    publisher = '\u0420\u0430\u0434\u0456\u043E \u0412\u0456\u043B\u044C\u043D\u0430 \u0404\u0432\u0440\u043E\u043F\u0430/\u0420\u0430\u0434\u0456\u043E \u0421\u0432\u043E\u0431\u043E\u0434\u0430 (\u0420\u0412\u0404/\u0420\u0421)'  # noqa: E501
    category = 'newspaper'
    cover_url = u'https://www.radiosvoboda.org/Content/responsive/RFE/uk-UA/img/top_logo_news.png'
    language = 'uk'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    remove_empty_feeds = True
    oldest_article = 7
    max_articles_per_feed = 20

    remove_tags_before = dict(name='h1')

    remove_tags_after = dict(name='div', attrs={'id': 'article-content'})

    remove_tags = [
        dict(name='p', attrs={'class': 'buttons btn--load-more'}),
        dict(name='div', attrs={'class': 'share--box'}),
        dict(name='div', attrs={'class': 'c-author__btns m-t-md'}),
        dict(
            name='div',
            attrs={'class': 'col-xs-12 col-md-4 pull-left live-blog-left'}
        ),
        dict(name='aside'),
        dict(name='div', attrs={'class': 'c-blockquote c-blockquote--has-quote'}),
        dict(name='div', attrs={'class': 'media-block also-read'}),
        dict(name='div', attrs={'class': 'media-block-wrap'}),
        dict(name='div', attrs={'class': 'wsw__embed'}),
        dict(name='div', attrs={'id': 'comments'}),
    ]

    feeds = [
        (
            '\u0413\u043E\u043B\u043E\u0432\u043D\u0456 \u043D\u043E\u0432\u0438\u043D\u0438',
            'https://www.radiosvoboda.org/api/zrqiteuuir'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438: \u041A\u043E\u0440\u043E\u043D\u0430\u0432\u0456\u0440\u0443\u0441',
            'https://www.radiosvoboda.org/api/zqk_myekpymv'
        ),
        (
            '\u041C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0456 \u043D\u043E\u0432\u0438\u043D\u0438',
            'https://www.radiosvoboda.org/api/zipkqejjki'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438: \u041F\u043E\u043B\u0456\u0442\u0438\u043A\u0430',
            'https://www.radiosvoboda.org/api/zppkoe-jkp'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438: \u0415\u043A\u043E\u043D\u043E\u043C\u0456\u043A\u0430',
            'https://www.radiosvoboda.org/api/zvpk_eo-kt'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438: \u0421\u0443\u0441\u043F\u0456\u043B\u044C\u0441\u0442\u0432\u043E',
            'https://www.radiosvoboda.org/api/zjmkreybko'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438: \u041F\u043E\u0434\u0456\u0457',
            'https://www.radiosvoboda.org/api/ztpkyei-kr'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438: \u0421\u0432\u043E\u0431\u043E\u0434\u0430 \u0441\u043B\u043E\u0432\u0430',
            'https://www.radiosvoboda.org/api/zmrjoebtjo'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438: \u041A\u043E\u0440\u0443\u043F\u0446\u0456\u044F',
            'https://www.radiosvoboda.org/api/zbobpoetgbpi'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438: \u0412\u0430\u0436\u043B\u0438\u0432\u0456',
            'https://www.radiosvoboda.org/api/zmyqmvebromr'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438: \u0421\u043F\u043E\u0440\u0442',
            'https://www.radiosvoboda.org/api/ztpmmyei-mmy'
        ),
        (
            '\u041F\u0443\u0431\u043B\u0456\u043A\u0430\u0446\u0456\u0457',
            'https://www.radiosvoboda.org/api/ziibp_ejgbpy'
        ),
        (
            '\u041F\u043E\u043B\u0456\u0442\u0438\u043A\u0430',
            'https://www.radiosvoboda.org/api/ziqioejuip'
        ),
        (
            '\u0421\u0443\u0441\u043F\u0456\u043B\u044C\u0441\u0442\u0432\u043E',
            'https://www.radiosvoboda.org/api/z_qi_erkiy'
        ),
        (
            '\u0415\u043A\u043E\u043D\u043E\u043C\u0456\u043A\u0430',
            'https://www.radiosvoboda.org/api/zpyp_e-rm_'
        ),
        (
            '\u041A\u0443\u043B\u044C\u0442\u0443\u0440\u0430',
            'https://www.radiosvoboda.org/api/zmqipebui_'
        ),
        (
            '\u0423\u043A\u0440\u0430\u0457\u043D\u0430',
            'https://www.radiosvoboda.org/api/zqqirekuiq'
        ),
        ('\u0421\u0432\u0456\u0442', 'https://www.radiosvoboda.org/api/zoqiqeguii'),
        (
            '\u0412\u0430\u0436\u043B\u0438\u0432\u0435 \u043D\u0430 \u0421\u0432\u043E\u0431\u043E\u0434\u0456',
            'https://www.radiosvoboda.org/api/zkk-iqemmbii'
        ),
        (
            '\u0412\u0456\u0439\u043D\u0430',
            'https://www.radiosvoboda.org/api/zijqpqej_opi'
        ),
        (
            '\u0414\u043E\u043D\u0431\u0430\u0441',
            'https://www.radiosvoboda.org/api/z_rppyeruppy'
        ),
        (
            '\u041A\u0440\u0438\u043C',
            'https://www.radiosvoboda.org/api/zbypmietqmmi'
        ),
        (
            '\u0422\u043E\u0447\u043A\u0430 \u0437\u043E\u0440\u0443',
            'https://www.radiosvoboda.org/api/zpqiie-uim'
        ),
        (
            '\u041A\u043E\u0440\u043E\u043D\u0430\u0432\u0456\u0440\u0443\u0441',
            'https://www.radiosvoboda.org/api/zok_mvegpymt'
        ),
        (
            '\u0421\u043F\u043E\u0440\u0442',
            'https://www.radiosvoboda.org/api/z-q_mpevk_m_'
        ),
        (
            '\u041A\u0438\u0442\u0430\u0439: \u0432\u0438\u043A\u043B\u0438\u043A\u0438',
            'https://www.radiosvoboda.org/api/zkyymqemqvmo'
        ),
        (
            '\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u0439\u043D\u0430 \u0432\u0456\u0439\u043D\u0430',
            'https://www.radiosvoboda.org/api/zuoppyepgppv'
        ),
        (
            '\u0420\u0430\u0434\u0456\u043E \u0421\u0432\u043E\u0431\u043E\u0434\u0430 Weekly',
            'https://www.radiosvoboda.org/api/zb_rmyetrqmv'
        ),
        (
            '\u041D\u043E\u0432\u0438\u043D\u0438 \u041F\u0440\u0438\u0430\u0437\u043E\u0432\u2019\u044F',
            'https://www.radiosvoboda.org/api/zkkvmyemmtmy'
        ),
        (
            '\u041F\u043E\u0434\u0456\u0457',
            'https://www.radiosvoboda.org/api/z-ppp_ev-ppv'
        ),
        (
            '\u0421\u0445\u0435\u043C\u0438',
            'https://www.radiosvoboda.org/api/z-miprevbipo'
        ),
        (
            '\u0421\u0445\u0435\u043C\u0438: \u0420\u043E\u0437\u0441\u043B\u0456\u0434\u0443\u0432\u0430\u043D\u043D\u044F',
            'https://www.radiosvoboda.org/api/ztvppoeiompo'
        ),
        (
            '\u0421\u0445\u0435\u043C\u0438: \u041D\u043E\u0432\u0438\u043D\u0438',
            'https://www.radiosvoboda.org/api/zyibpreqjbpo'
        )
    ]
